import java.util.Scanner;

public class Main {


    public static void main1(String[] args) {


    }
    
    //杨辉三角
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int[][] b= new int[a+1][a+1];
        for (int i = 0; i <= a; i++) {
            b[i][0]=1;
        }
        for (int i = 1; i <= a; i++) {
            for (int j = 1; j <= i; j++) {
                b[i][j] = b[i-1][j-1] + b[i-1][j];
            }
        }

        for (int i = 0; i < a; i++) {
            for (int j = 0; j <= i; j++) {
                if (b[i][j] != 0){
                    StringBuffer ret = new StringBuffer();
                    int len = Integer.toString(b[i][j]).length();
                    for (int k = 0; k < 5-len; k++) {
                        ret.append(" ");
                    }
                    System.out.print(ret.toString()+b[i][j]);
                }
            }
            if (i+1 !=a){
                System.out.println();
            }
        }
    }
    
    

    //单词搜索
    static int m = 0;
    static int n = 0;
    static int[] dx = {1,-1,0,0};
    static int[] dy = {0,0,1,-1};
    static boolean[][] vis;
    static char[] word;

    public static boolean exist(String[] board,String _word){
        m = board.length;;
        n = board[0].length();
        word = _word.toCharArray();
        char[][] a = new char[m][n];
        vis = new boolean[m][n];
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                if (board[i].charAt(j) == word[0]){
                    vis[i][j] = true;
                    if (dfs(board,i,j,0) == true){
                        return true;
                    }
                    vis[i][j] = false;
                }
            }
        }
        return false;
    }
    public static boolean dfs(String[] board,int i,int j,int pos){
        if (pos == word.length-1){
            return true;
        }
        for (int k = 0; k < 4; k++) {
            int x = i+dx[k];
            int y = j+dy[k];
            if (x>=0 && x<m && y>=0 && y<n &&board[x].charAt(y) == word[pos+1] && vis[x][y] == false){
                vis[x][y] = true;
                if (dfs(board,x,y,pos+1) == true){
                    return true;
                }
                vis[x][y] = false;
            }
        }
        return false;
    }
}